<template>
  <div id="app">
    <!-- <div id="nav">
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link>
    </div> -->
    <!-- <router-view /> -->

    <div class="top">
      <div class="logo">
        <img src="../public/img/logo.png" alt="" />
      </div>
      <p class="xiazai">下载酷狗</p>
      <van-icon name="search" />
    </div>

    <ul class="bottom">
      <li v-for="(item, index) in arr" :key="index" @click="fn_data(index)">
        <router-link :to="item.luyou">
          <p :class="{active:one===index}">{{item.name}}</p>
        </router-link>
      </li>
    </ul>
    <router-view />
  </div>
</template>

<script>
export default {
  name:"App",
  data(){
    return {
      one:0,
      arr:[
        {
          name:"新歌",
          luyou:"/",

        },
        {
          name:"排行",
          luyou:"/rangking",
        },
        {
          name:"歌单",
          luyou:"/song",
        },
        {
          name:"歌手",
          luyou:"/singer",
        },
        {
          name:"听书",
          luyou:"/listen",
        }
      ]
    }
  },
  methods:{
    fn_data(index){
      this.one=index;
    }
  }
}
</script>

<style scoped>
html,body{
  width: 7.5rem;
  overflow-x: hidden;
}
#app {
  width: 100%;
}
#app > .top {
  width: 100%;
  height: .96rem;
  background: #2ca2f9;
  display: flex;
  padding-top: .2rem;
  position: fixed;
  top: 0;
  z-index: 99;
}
#app > .top>.logo{
  width: 2.8rem;
  height: .76rem;
  margin-left: .2rem;
}
#app > .top>.logo>img{
  width:100%;
  height: 100%;
}
#app > .top>.xiazai{
  color: #fff;
  width:2.08rem;
  height: .64rem;
  text-align: center;
  line-height: .64rem;
  border: .02rem solid #fff;
  border-radius: .2rem;
  margin-left: .6rem;
  margin-top: .06rem;
}
#app > .top>.sousuo{
  line-height: .96rem;
  color: #fff;
  margin-left: 1rem;
}
#app > .top>.sousuo>i{
  font-size: .5rem;
  font-weight: bold;
}
#app > .top>i{
  margin-left: 1rem;
  margin-top: .1rem;
  font-size: .5rem;
  font-weight: bold;
  color:#fff;
}
#app .bottom{
  width: 100%;
  height: 1rem;
  display: flex;
  justify-content: space-around;
  background: #fff;
  justify-content: space-around;
  position: fixed;
  top: 1rem;
  z-index: 99;
}
#app .bottom>li{
  line-height: 1rem;
  width: 20%;
  text-align: center;
  color: #333;
}
#app .bottom>li p{
  font-size: .4rem;
}
.active{
  border-bottom: .1rem solid #2ca2f9;
}
</style>
